Skip to content

)} )} ,System.Action{System.Exception},System.Action)} ,System.Func{System.Exception,--0},System.Func{--0})}

Notification.Accept(IObserver) method

Defined in

Type: Notification Namespace: System.Reactive Assembly: System.Reactive.dll

Applies to

netstandard2.0

Overloads

  • 1. public abstract void Accept(IObserver<T> observer)
  • 2. public abstract TResult Accept<TResult>(IObserver<T, TResult> observer)
  • 3. public abstract void Accept(Action<T> onNext, Action<Exception> onError, Action onCompleted)
  • 4. public abstract TResult Accept<TResult>(Func<T, TResult> onNext, Func<Exception, TResult> onError, Func<TResult> onCompleted)

1. Overload

public abstract void Accept(IObserver<T> observer)

Summary: Invokes the observer's method corresponding to the notification.

Parameters

NameTypeDescription
observerIObserverObserver to invoke the notification on.

2. Overload

public abstract TResult Accept<TResult>(IObserver<T, TResult> observer)

Summary: Invokes the observer's method corresponding to the notification and returns the produced result.

Type parameters

NameDescription
TResultThe type of the result returned from the observer's notification handlers.

Parameters

NameTypeDescription
observer[IObserver](#Observer to invoke the notification on.

Returns: TResult -- Result produced by the observation.

3. Overload

public abstract void Accept(Action<T> onNext, Action<Exception> onError, Action onCompleted)

Summary: Invokes the delegate corresponding to the notification.

Parameters

NameTypeDescription
onNextActionDelegate to invoke for an OnNext notification.
onErrorActionDelegate to invoke for an OnError notification.
onCompletedActionDelegate to invoke for an OnCompleted notification.

4. Overload

public abstract TResult Accept<TResult>(Func<T, TResult> onNext, Func<Exception, TResult> onError, Func<TResult> onCompleted)

Summary: Invokes the delegate corresponding to the notification and returns the produced result.

Type parameters

NameDescription
TResultThe type of the result returned from the notification handler delegates.

Parameters

NameTypeDescription
onNextFuncDelegate to invoke for an OnNext notification.
onErrorFuncDelegate to invoke for an OnError notification.
onCompletedFuncDelegate to invoke for an OnCompleted notification.

Returns: TResult -- Result produced by the observation.